<template>
  <van-nav-bar :border="false" :title="title" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
    <template #left>
      <van-icon v-if="showLeftIcon" :name="LeftIcon" size="18" />
    </template>
    <template #right>
      <van-icon v-if="showRightIcon" :name="RightAdd" size="18" />
    </template>
  </van-nav-bar>
</template>
  
<script setup lang="ts">
import { defineProps } from 'vue';
import LeftIcon from '@/assets/images/icon/my-account/left.png';
import RightAdd from '@/assets/images/icon/my-account/add.png';
import { useRouter } from 'vue-router';
const router = useRouter();
defineProps({
  title: {
    type: String,
    default: ''
  },
  showRightIcon: {
    type: Boolean,
    default: true
  },
  showLeftIcon: {
    type: Boolean,
    default: true
  }
});

const onClickLeft = () => {
  history.back()
};
const onClickRight = () => {
  router.push({
    path:'addAPaymentMethod'
  })
};
</script>
  
<style scoped lang="scss">
:deep(.van-nav-bar__title ){
  font-size: 9px;
}
</style>
  